package mobilesearch.receiver;

import java.util.ArrayList;

import android.util.Log;

import mobilesearch.data.AppData;
import mobilesearch.ui.OnSearchResultListener;

public class AppReceiver {

	private static final String TAG = "AppReceiver";
	private ArrayList<AppData> appList;
	private OnSearchResultListener listener;
	
	public AppReceiver(ArrayList<AppData> audioList, OnSearchResultListener listener) {
		this.appList = audioList;
		this.listener = listener;
	}
	
	public void processAppData(){
		int size = this.appList.size();
		Log.i(TAG, "app list"+ size);
		for(int i = 0; i < size; i++){
			AppData data = this.appList.get(i);
			String name = data.getAppName();
			Log.i(TAG, "name = "+name);
			String version = data.getAppVersion();
			Log.i(TAG, "version = " + version);
			this.listener.onReceiveAppData(name, version);
		}
	}

}
